package com.controller.strategy;

import com.model.pojo.RepEntity;
import com.model.vo.configVo.ObjectInfo;
import com.model.vo.configVo.StrategysInfo;
import com.server.strategy.StrategysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class StrategysController {
    @Autowired
    StrategysService strategysService;
    /*
   添加数据源策略
    */
    @RequestMapping("/addStrategys")
    public RepEntity addStrategys(@RequestBody StrategysInfo body){
        return strategysService.addStrategys(body);
    }

    /*
    删除数据源策略
     */
    @RequestMapping("/delDbStrategys")
    public RepEntity delDbStrategys(@RequestBody List<Integer> body){
        return strategysService.delDbStrategys(body);
    }

    /*
    删除图表策略
     */
    @RequestMapping("/delChartStrategys")
    public RepEntity delChartStrategys(@RequestBody List<Integer> body){
        return strategysService.delChartStrategys(body);
    }

    /*
    更新数据源策略
     */
    @RequestMapping("/updateStrategys")
    public RepEntity updateStrategys(@RequestBody StrategysInfo body){
        return strategysService.updateStrategys(body);
    }

    /*
    查询数据源策略
     */
    @RequestMapping("/getDbStrategys")
    public RepEntity getDbStrategys(@RequestBody int body){
        return strategysService.getDbStrategys(body);
    }

    /*
    添加用户或用户组
     */
    @RequestMapping("/addObject")
    public RepEntity addObject(@RequestBody ObjectInfo body){
        return strategysService.addObject(body);
    }

    /*
    删除对象
     */
//    @RequestMapping("/delObject")
//    public RepEntity delObject(@RequestBody ObjectInfo body){
//        return strategysService.delObject(body);
//    }

    /*
    查询图表策略
     */
    @RequestMapping("/getChartStrategys")
    public RepEntity getChartStrategys(@RequestBody int body){
        return strategysService.getChartStrategys(body);
    }
}